package com.my.test.jvm;

public class MemoryCal {

    public static void main(String[] args) {
        // jvm试图使用的最大内存
        long maxMemory = Runtime.getRuntime().maxMemory();
        // jvm总内存
        long totalMemory =  Runtime.getRuntime().totalMemory();

        System.out.println("maxMemory:"+maxMemory);
        System.out.println("totalMemory:"+totalMemory);
    }
}
